找传奇、传世资源到传世资源站!

C# For Financial Market.pdf

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

from clipboard
ContentsList of Figures xixList of Tables xxiiiIntroduction 10.1 What Is This Book? 10.2 Special Features in This Book 10.3 Who Is This Book for and What Do You Learn? 20.4 Structure of This Book 20.5 C# Source Code 31 Global Overview of the Book 51.1 Introduction and Objectives 51.2 Comparing C# and C 51.3 Using This Book 62 C# Fundamentals 92.1 Introduction and Objectives 92.2 Background to C# 92.3 Value Types, Reference Types and Memory Management 102.4 Built-in Data Types in C# 102.5 Character and String Types 122.6 Operators 132.7 Console Input and Output 142.8 User-defined Structs 152.9 Mini Application: Option Pricing 162.10 Summary and Conclusions 212.11 Exercises and Projects 223 Classes in C# 253.1 Introduction and Objectives 253.2 The Structure of a Class: Methods and Data 253.3 The Keyword ‘this’ 28iv Contents3.4 Properties 283.5 Class Variables and Class Methods 303.6 Creating and Using Objects in C# 333.7 Example: European Option Price and Sensitivities 333.7.1 Supporting Mathematical Functions 343.7.2 Black-Scholes Formula 353.7.3 C# Implementation 363.7.4 Examples and Applications 393.8 Enumeration Types 403.9 Extension Methods 423.10 An Introduction to Inheritance in C# 443.11 Example: Two-factor Payoff Hierarchies and Interfaces 463.12 Exception Handling 503.13 Summary and Conclusions 503.14 Exercises and Projects 514 Classes and C# Advanced Features 534.1 Introduction and Objectives 534.2 Interfaces 534.3 Using Interfaces: Vasicek and Cox-Ingersoll-Ross (CIR) Bondand Option Pricing 544.3.1 Defining Standard Interfaces 554.3.2 Bond Models and Stochastic Differential Equations 554.3.3 Option Pricing and the Visitor Pattern 584.4 Interfaces in .NET and Some Advanced Features 614.4.1 Copying Objects 624.4.2 Interfaces and Properties 634.4.3 Comparing Abstract Classes and Interfaces 644.4.4 Explicit Interfaces 654.4.5 Casting an Object to an Interface 654.5 Combining Interfaces, Inheritance and Composition 674.5.1 Design Philosophy: Modular Programming 674.5.2 A Model Problem and Interfacing 684.5.3 Implementing the Interfaces 694.5.4 Examples and Testing 724.6 Introduction to Delegates and Lambda Functions 724.6.1 Comparing Delegates and Interfaces 744.7 Lambda Functions and Anonymous Methods 764.8 Other Features in C# 774.8.1 Static Constructors 774.8.2 Finalisers 784.8.3 Casting 794.8.4 The var Keyword 804.9 Advanced .NET Delegates 804.9.1 Provides and Requires Interfaces: Creating Plug-in Methodswith Delegates 824.9.2 Multicast Delegates 85Contents v4.9.3 Generic Delegate Types 864.9.4 Delegates versus Interfaces, Again 874.10 The Standard Event Pattern in .NET and the Observer Pattern 874.11 Summary and Conclusions 914.12 Exercises and Projects 925 Data Structures and Collections 975.1 Introduction and Objectives 975.2 Arrays 975.2.1 Rectangular and Jagged Arrays 985.2.2 Bounds Checking 1015.3 Dates, Times and Time Zones 1015.3.1 Creating and Modifying Dates 1015.3.2 Formatting and Parsing Dates 1035.3.3 Working with Dates 1045.4 Enumeration and Iterators 1055.5 Object-based Collections and Standard Collection Interfaces 1075.6 The List<T> Class 1095.7 The Hashtable<T> Class 1105.8 The Dictionary<Key, Value> Class 1115.9 The HashSet<T> Classes 1125.10 BitArray: Dynamically Sized Boolean Lists 1145.11 Other Data Structures 1145.11.1 Stack<T> 1145.11.2 Queue<T> 1155.11.3 Sorted Dictionaries 1165.12 Strings and StringBuilder 1175.12.1 Methods in string 1185.12.2 Manipulating Strings 1195.13 Some new Features in .NET 4.0 1205.13.1 Optional Parameters 1205.13.2 Named Parameters 1215.13.3 COM Interoperability in .NET 4.0 1215.13.4 Dynamic Binding 1225.14 Summary and Conclusions 1235.15 Exercises and Projects 1236 Creating User-defined Data Structures 1256.1 Introduction and Objectives 1256.2 Design Rationale and General Guidelines 1256.2.1 An Introduction to C# Generics 1256.2.2 Generic Methods and Generic Delegates 1286.2.3 Generic Constraints 1296.2.4 Generics, Interfaces and Inheritance 1306.2.5 Other Remarks 1306.3 Arrays and Matrices 1316.4 Vectors and Numeric Matrices 135vi Contents6.5 Higher-dimensional Structures 1396.6 Sets 1406.7 Associative Arrays and Matrices 1426.7.1 Associative Arrays 1426.7.2 Associative Matrices 1446.8 Standardisation: Interfaces and Constraints 1456.9 Using Associative Arrays and Matrices to Model Lookup Tables 1526.10 Tuples 1556.11 Summary and Conclusions 1566.12 Exercises and Projects 1567 An Introduction to Bonds and Bond Pricing 1597.1 Introduction and Objectives 1597.2 Embedded Optionality 1607.3 The Time Value of Money: Fundamentals 1607.3.1 A Simple Bond Class 1647.3.2 Testing the Bond Functionality 1657.4 Measuring Yield 1667.5 Macauley Duration and Convexity 1677.6 Dates and Date Schedulers for Fixed Income Applications 1687.6.1 Accrued Interest Calculations and Day Count Conventions 1697.6.2 C# Classes for Dates 1707.6.3 DateSchedule Class 1747.7 Exporting Schedulers to Excel 1767.8 Other Examples 1777.9 Pricing Bonds: An Extended Design 1787.10 Summary and Conclusions 1817.10.1 Appendix: Risks Associated with Bonds 1817.11 Exercises and Projects 1818 Data Management and Data Lifecycle 1858.1 Introduction and Objectives 1858.2 Data Lifecycle in Trading Applications 1858.2.1 Configuration Data and Calculated Data 1868.2.2 Which Kinds of Data Storage Devices Can We Use? 1868.3 An Introduction to Streams and I/O 1868.3.1 Stream Architecture 1868.3.2 Backing Store Streams Functionality 1878.3.3 Stream Decorators 1898.3.4 Stream Adapters 1918.4 File and Directory Classes 1958.4.1 The Class Hierarchy 1968.4.2 FileInfo and DirectoryInfo Classes 1988.5 Serialisation Engines in .NET 1998.5.1 DataContractSerializer 1998.5.2 NetDataContractSerializer 201Contents vii8.5.3 Formatters 2018.5.4 Implicit and Explicit Serialisation 2038.6 The Binary Serialiser 2038.7 XML Serialisation 2048.7.1 Subclasses and Child Objects 2058.7.2 Serialisation of Collections 2068.7.3 The IXmlSerializable Interface 2078.8 Data Lifetime Management in Financial and Trading Applications 2098.9 Summary and Conclusions 2138.10 Exercises and Projects 2139 Binomial Method, Design Patterns and Excel Output 2159.1 Introduction and Objectives 2159.2 Design of Binomial Method 2169.3 Design Patterns and Classes 2179.3.1 Creating Input Data: Factory Method Pattern 2179.3.2 Binomial Parameters and the Strategy Pattern 2199.3.3 The Complete Application Object and the Mediator Pattern 2289.3.4 Lattice Presentation in Excel 2309.4 Early Exercise Features 2329.5 Computing Hedge Sensitivities 2339.6 Multi-dimensional Binomial Method 2339.7 Improving Performance Using Pade Rational Approximants 236 ´9.8 Summary and Conclusions 2389.9 Projects and Exercises 23810 Advanced Lattices and Finite Difference Methods 24110.1 Introduction and Objectives 24110.2 Trinomial Model of the Asset Price and Its C# Implementation 24110.3 Stability and Convergence of the Trinomial Method 24610.4 The Black-Scholes Partial Differential Equation and Explicit Schemes 24610.5 Implementing Explicit Schemes in C# 24710.5.1 Using the Explicit Finite Difference Method 25110.6 Stability of the Explicit Finite Difference Scheme 25210.7 An Introduction to the Alternating Direction Explicit Method (ADE) 25510.7.1 ADE in a Nutshell: The One-factor Diffusion Equation 25510.7.2 ADE for Equity Pricing Problems 25610.8 Implementing ADE for the Black-Scholes PDE 25810.9 Testing the ADE Method 26210.10 Advantages of the ADE Method 26310.11 Summary and Conclusions 26310.12 Appendix: ADE Numerical Experiments 26310.13 Exercises and Projects 26811 Interoperability: Namespaces, Assemblies and C /CLI 27111.1 Introduction and Objectives 271viii Contents11.2 Namespaces 27111.2.1 Applications of Namespaces 27211.3 An Introduction to Assemblies 27311.3.1 Assembly Types 27411.3.2 Specifying Assembly Attributes in AssemblyInfo.cs 27511.3.3 The Relationship between Namespaces and Assemblies 27611.4 Reflection and Metadata 27611.4.1 Other Classes in the Reflection Namespace 28111.4.2 Dynamic Method Invocation 28311.4.3 Dynamic Object Creation 28311.4.4 Dynamic Assembly Loading 28411.4.5 Attributes and Reflection 28411.4.6 Custom Attributes 28611.5 C# and Native C Interoperability: How Is That Possible? 28911.5.1 Using Native C from C# 28911.6 Using C# from C 29311.7 Code Generation Using the Reflection API 29811.7.1 The DynamicMethod Class 29911.7.2 The Evaluation Stack and Argument Passing toDynamic Methods 30011.7.3 The Case in Hand: Operator Overloading for GenericVectors and Matrices 30111.8 Application Domains 30411.8.1 Creating and Destroying Application Domains 30411.8.2 Multiple Application Domains 30511.8.3 Sharing Data between Domains 30711.8.4 When to Use Application Domains 30811.9 Summary and Conclusions 30911.10 Exercises and Projects 30912 Bond Pricing: Design, Implementation and Excel Interfacing 31112.1 Introduction and Objectives 31112.2 High-level Design of Bond Pricing Problem 31112.3 Bond Scheduling 31212.4 Bond Functionality and Class Hierarchies 31312.5 Calculating Price, Yield and Discount Factors: MathTools 31712.6 Data Presentation and Excel Interop 31912.7 Bond Data Management 32112.7.1 Data into Memory 32112.7.2 Serialisation and Deserialisation 32212.8 Using the Excel Files 32412.9 Summary and Conclusions 32812.10 Exercises and Projects 3281 Code Integration: Handling Bond Details 3282 Spread on Benchmark 3303 Floating Rate Bond and Other Structured Notes 3314 Class Hierarchy Integration 333Contents ix13 Interpolation Methods in Interest Rate Applications 33513.1 Introduction and Objectives 33513.2 Interpolation and Curve Building: Basic Formula for Interpolator Tests 33513.3 Types of Curve Shape 33713.4 An Overview of Interpolators 33813.5 Background to Interpolation 33913.6 Approximation of Function Derivatives 34113.7 Linear and Cubic Spline Interpolation 34213.8 Positivity-preserving Cubic Interpolations: Dougherty/Hymanand Hussein 34413.9 The Akima Method 34813.10 Hagan-West Approach 34913.11 Global Interpolation 35013.11.1 Polynomial Interpolation 35113.11.2 Rational Interpolation 35213.12 Bilinear Interpolation 35213.13 Some General Guidelines, Hints and Tips 35513.14 Using the Interpolators and Test Examples 35713.14.1 The 101 Example, from A to Z 35713.14.2 Some Financial Formulae 36013.14.3 Cubic Spline Interpolation: an Application Example 36113.14.4 A Bilinear Interpolation Simple Example 36413.15 Summary and Conclusions 36713.16 Exercises and Projects 36714 Short Term Interest Rate (STIR) Futures and Options 36914.1 Introduction and Objectives 36914.2 An Overview of Cash Money Markets 37014.3 Sources of Risk in Money Market Transactions 37014.4 Reference Rate and Fixings 37114.5 STIR Futures 37114.6 Pricing STIR Options 37414.7 Generating International Monetary Market (IMM) Dates 37814.7.1 Modelling Option Delta and Sensitivity Analysis 38014.7.2 Listed Instruments and Contracts 38314.8 List STIR Futures and STIR Futures Options 38414.9 Putting It All Together: STIR versus OTC from a Trader’s Perspective 38714.10 Summary and Conclusions 38914.11 Exercises and Projects 38915 Single-curve Building 39315.1 Introduction and Objectives 39315.2 Starting Definitions and Overview of Curve Building Process 39315.3 Building Blocks 39515.3.1 Unsecured Deposit 39515.3.2 Forward Rate Agreements (FRA) 39615.3.3 Future Implied Rate 39715.3.4 Interest Rate Swap (IRS) 397x Contents15.4 Introduction to Interest Rate Swap 39715.4.1 IRS Cash Flow 39815.4.2 The Use of Interest Rate Swaps 39915.4.3 Contract Specification and Practical Aspects 39915.4.4 Traditional Swap Valuation 40215.4.5 Overnight Index Swap (OIS) 40315.5 The Curve Construction Mechanism 40315.5.1 Traditional Bootstrapping Method 40415.5.2 Best Fit Method 40515.5.3 The Key Role of Interpolation 40515.6 Code Design and Implementation 40615.6.1 Process Design 40615.6.2 ISingleRateCurve Interface 40615.6.3 RateSet Class and BuildingBlock Class 40715.6.4 Interpolator and Adapters 40915.6.5 The Generic Base Class SingleCurveBuilder 41015.6.6 Derived Class for Traditional Bootstrapping Method 41215.6.7 Derived Class for Global Method with Interpolation 41315.6.8 Derived Class for Global Method with Smoothness Condition 41515.7 Console Examples 41815.7.1 Calculating Present Value (PV) of the Floating Leg of a Swap 41815.7.2 Checking If the Curve is Calibrated 41815.7.3 Calculate the Time Taken to Instantiate aSingleCurveBuilder 41815.7.4 Visualise Forward Rates in Excel 41915.7.5 Computing Forward Start Swap 42115.7.6 Computing Sensitivities: An Initial Example 42115.7.7 More on Sensitivities 42215.8 Summary and Conclusions 42615.9 Exercises and Projects 42715.10 Appendix: Types of Swaps 42916 Multi-curve Building 43116.1 Introduction and Objectives 43116.2 The Consequences of the Crisis on Interest Rate Derivatives Valuation 43116.2.1 The Growing Importance of Overnight Indexed Swap 43216.2.2 Collateralisation under a CSA 43216.2.3 The Role of OIS Discounting: One Curve Is Not Enough 43316.2.4 Basis 43316.2.5 The Par Swap Rate Formulae 43416.3 Impact of Using OIS Discounting 43616.3.1 Effect on Forward Rates 43616.3.2 Effect on Mark-to-Market 43616.3.3 Risk Effect 43616.4 The Bootstrapping Process Using Two Curves: Descriptionof the Mechanism 437Contents xi16.5 Sensitivities 43816.6 How to Organise the Code: A Possible Solution 43916.6.1 IRateCurve Base Interface and Derived Interfaces 43916.6.2 The class MultiCurveBuilder 44116.7 Putting it Together, Working Examples 44516.7.1 Calibration Consistency 44516.7.2 Print Forward Rates and Discount Factors on Excel 44616.7.3 Sensitivities on Console 44616.7.4 Forward Swap Matrix 44716.7.5 Mark-to-Market Differences 44816.7.6 Comparing Two Versions of the MultiCurveBuilder 45016.7.7 Input Data, Interpolation and Forward Rates 45216.7.8 Comparing Discount Factor 45316.8 Summary and Conclusions 45316.9 Exercises and Projects 45316.10 Appendix: Par Asset Swap Spread and Zero Volatility Spread 45517 Swaption, Cap and Floor 45917.1 Introduction and Objectives: A Closed Formula World 45917.2 Description of Instruments and Formulae 45917.2.1 Cap and Floor: Description and Formulae 45917.2.2 Cap and Floor at the money Strike 46117.2.3 Cap Volatility and Caplet Volatility 46217.2.4 Implied Volatility 46317.2.5 Multi-strike and Amortising Cap and Floor 46317.2.6 Swaption: Mechanism and Closed Pricing Formulae 46417.2.7 Call Put Parity for Cap, Floor and Swaption 46617.3 Multi-curve Framework on Cap, Floor and Swaption 46717.4 Bootstrapping Volatility for Cap and Floor 46917.4.1 Cap Stripping 46917.4.2 Missing Data, Volatility Models and Interpolation 47317.5 How to Organise the Code in C#: A Possible Solution 47417.5.1 Ready to Use Formula 47417.5.2 Cap Stripping Code 47617.5.3 Calculating Mono-strike Caplet Volatilities 47617.5.4 Managing More Mono-strike Caplet Volatilities 47917.6 Console and Excel Working Examples 48117.6.1 Simple Caplet Price 48117.6.2 Cap As a Sum of Caplets 48217.6.3 Simple Cap Volatility Bootstrapping: First UnknownVolatility 48317.6.4 ATM Strike and Recursive Bootstrapping 48517.6.5 Sparse Data from the Market: Volatility Optimisation andInput Interpolation 48717.7 Summary and Conclusions 49017.8 Exercise and Discussion 491xii Contents18 Software Architectures and Patterns for Pricing Applications 49318.1 Introduction and Objectives 49318.2 An Overview of the GOF Pattern 49418.3 Creational Patterns 49618.4 Builder Pattern 49618.5 Structural Patterns 49918.5.1 Facade Pattern 49918.5.2 Layers Pattern 49918.6 Behavioural Patterns 50018.6.1 Visitor Pattern 50118.6.2 Strategy and Template Method Patterns 50118.7 Builder Application Example: Calibration Algorithms for Cap and Floor 50218.7.1 Example Caplet Volatility Matrix 50218.7.2 Volatility Matrix with Multiple Strikes 50318.8 A PDE/FDM Patterns-based Framework for Equity Options 50418.8.1 High-level Design 50618.8.2 Generalisations and Extensions 50818.9 Using Delegates to Implement Behavioural Design Patterns 50918.10 A System Design for Monte Carlo Applications 51018.10.1 A Universal System Design Methodology 51118.11 Dynamic Programming in .NET 51318.11.1 Numeric Type Unification 51418.11.2 Implementing Dynamic Objects 51618.12 Summary and Conclusions 51618.13 Exercises and Projects 51719 LINQ (Language Integrated Query) and Fixed Income Applications 52319.1 Introduction and Objectives 52319.2 Scope of Chapter and Prerequisites 52319.3 LINQ Query Operators 52419.3.1 Collection as Input, Collection as Output 52419.3.2 Collection as Input, Noncollection as Output 52519.3.3 Noncollection to Collection 52619.4 LINQ Queries and Initial Examples 52619.4.1 Lambda Queries and Composition 52719.4.2 Comprehension Queries 52819.4.3 Deferred Execution 52919.5 Advanced Queries 53119.5.1 Subqueries 53119.5.2 Composition Strategies 53219.5.3 Interpreted Queries 53319.6 A Numerical Example 53319.6.1 Basic Functionality 53319.6.2 User-defined Aggregation Methods 53419.6.3 Set Operations 53519.7 Join and GroupJoin 535Contents xiii19.8 Examples in Fixed Income Applications 54019.8.1 Using Conversion Operators 54019.8.2 Discount Factors 54019.8.3 Bonds 54219.8.4 Scenarios 54319.8.5 Cash Flow Aggregation 54519.8.6 Ordering Collections 54619.8.7 Eonia Rates Replication 54719.9 LINQ and Excel Interoperability 54919.9.1 Applications in Computational Finance 55719.10 Summary and Conclusions 55719.11 Exercises and Projects 55720 Introduction to C# and Excel Integration 56120.1 Introduction and Objectives 56120.2 Excel Object Model 56120.3 Using COM Technology in .NET 56120.4 Primary Interop Assemblies (PIA) 56320.5 Standalone Applications 56420.5.1 Standalone Application: Workbook and Worksheets 56420.5.2 Charts 56520.5.3 Using Excel with C /CLI 56520.6 Types of Excel Add-ins 56620.6.1 XLL 56720.6.2 XLA 56720.6.3 COM 56720.6.4 Automation 56720.6.5 VSTO 56820.7 The IDTExtensibility2 Interface and COM/.NET Interoperability 56920.8 Data Visualisation in Excel 57020.8.1 Excel Driver 57020.8.2 Data Structures 57220.8.3 ExcelMechanisms and Exception Handling 57220.8.4 Examples and Applications 57520.9 Conclusion and Summary 57820.10 Exercises and Projects 57921 Excel Automation Add-ins 58121.1 Introduction and Objectives 58121.2 COM Overview 58121.3 Creating Automation Add-ins: The Steps 58321.4 Example: Creating a Calculator, Version 1 58521.5 Example: Creating a Calculator, Version 2 58821.6 Versioning 59021.7 Working with Ranges 59021.8 Volatile Methods 590xiv Contents21.9 Optional Parameters 59121.10 Using VBA with Automation Add-ins 59221.11 Summary and Conclusions 59321.12 Exercises and Projects 59422 C# and Excel Integration COM Add-ins 59522.1 Introduction and Objectives 59522.2 Preparations for COM Add-ins 59522.3 The Interface IDTExtensibility2 59622.4 Creating COM Add-ins: The Steps 59622.5 Utility Code and Classes 59722.6 Using Windows Forms 60022.7 Example: Creating a COM Add-in 60122.8 Debugging and Troubleshooting 60322.9 An Introduction to Excel-DNA 60322.9.1 Example 001: Hello World 60422.9.2 Example 101: Simple Option Pricer 60522.9.3 Excel-DNA and Rate Curves 60822.9.4 Registration and Loading 61322.9.5 What Is Inside ExcelDna.Integration.dll? 61422.10 Excel COM Interoperability and Rate Multi-curve 61522.11 Conclusion and Summary 62222.12 Exercises and Projects 62223 Real-time Data (RTD) Server 62523.1 Introduction and Objectives 62523.2 Real-time Data in Excel: Overview 62523.3 Real-time Data Function 62623.4 Example 62723.5 The Topic Class and Data 62923.6 Creating an RTD Server 63123.7 Using the RTD Server 63123.8 Testing and Troubleshooting the RTD Server 63223.9 Conclusion and Summary 63223.10 Exercises and Projects 63224 Introduction to Multi-threading in C# 63524.1 Introduction and Objectives 63524.2 Processes 63624.3 Using ProcessStartInfo to Redirect Process I/O 63724.4 An Introduction to Threads in C# 63824.4.1 The Differences between Processes and Threads 64124.5 Passing Data to a Thread and between Threads 64124.6 Thread States and Thread Lifecycle 64424.6.1 Sleep 64524.6.2 Thread Joining 64624.6.3 Thread Interrupt and Abort 64824.7 Thread Priority 650Contents xv24.8 Thread Pooling 65124.9 Atomic Operations and the Interlocked Class 65224.10 Exception Handling 65324.11 Multi-threaded Data Structures 65424.11.1 Extended Producer–Consumer Pattern 65724.12 A Simple Example of Traditional Multi-threading 65924.13 Summary and Conclusions 66124.14 Exercises and Projects 66125 Advanced Multi-threading in C# 66525.1 Introduction and Objectives 66525.2 Thread Safety 66625.3 Locking Mechanisms for Objects and Classes 66725.3.1 Locking a Class 66925.3.2 Nested Locking 66925.4 Mutex and Semaphore 67325.5 Notification and Signalling 67625.5.1 Thread Notification and the Monitor Class 67825.6 Asynchronous Delegates 67925.7 Synchronising Collections 68125.8 Timers 68225.9 Foreground and Background Threads 68425.10 Executing Operations on Separate Threads: the BackgroundWorkerClass 68525.11 Parallel Programming in .NET 68725.11.1 The Parallel Class 68725.12 Task Parallel Library (TPL) 69125.12.1 Creating and Starting Tasks 69225.12.2 Continuations 69425.13 Concurrent Data Structures 69425.13.1 An Example: Producer Consumer Pattern andRandom Number Generation 69525.13.2 The Barrier Class 69825.13.3 PLINQ 69925.14 Exception Handling 70125.15 Shifting Curves 70225.16 Summary and Conclusions 70425.17 Exercises and Projects 70426 Creating Multi-threaded and Parallel Applications forComputational Finance 70726.1 Introduction and Objectives 70726.2 Multi-threaded and Parallel Applications for Computational Finance 70726.3 Fork and Join Pattern 70926.4 Geometric Decomposition 71126.5 Shared Data and Reader/Writer Locks: Multiple Readersand Multiple Writers 71526.5.1 Upgradeable Locks and Recursion 718xvi Contents26.6 Monte Carlo Option Pricing and the Producer–Consumer Pattern 71926.7 The StopWatch Class 72626.8 Garbage Collection and Disposal 72726.8.1 Disposal and the IDisposable Interface 72726.8.2 Automatic Garbage Collection 72826.8.3 Managed Memory Leaks 73026.9 Summary and Conclusions 73026.10 Exercises and Projects 730A1 Object-oriented Fundamentals 735A1.1 Introduction and Objectives 735A1.2 Object-oriented Paradigm 735A1.3 Generic Programming 737A1.4 Procedural Programming 738A1.5 Structural Relationships 738A1.5.1 Aggregation 739A1.5.2 Association 740A1.5.3 Generalisation/Specialisation (Gen/Spec Relationship) 742A1.6 An Introduction to Concept Modelling 743A1.6.1 The Defining Attribute View 743A1.6.2 The Prototype View 744A1.6.3 The Exemplar-based View 744A1.6.4 The Explanation-based View 744A1.7 Categorisation and Concept Levels 745A1.8 Whole–Part Pattern 745A1.8.1 Data Decomposition 746A1.9 Message-passing Concept versus Procedural Programming 748A2 Nonlinear Least-squares Minimisation 751A2.1 Introduction and Objectives 751A2.2 Nonlinear Programming and Multi-variable Optimisation 751A2.3 Nonlinear Least Squares 753A2.3.1 Nonlinear Regression 753A2.3.2 Simultaneous Nonlinear Equations 754A2.3.3 Derivatives of Sum-of-Squares Functions 754A2.4 Some Specific Methods 755A2.5 The ALGLIB Library 756A2.6 An Application to Curve Building 758A2.7 Rate Calibration Example 759A2.8 Exercises and Projects 764A3 The Mathematical Background to the Alternating DirectionExplicit (ADE) Method 765A3.1 Introduction and Objectives 765A3.2 Background to ADE 765A3.3 Scoping the Problem: One-factor Problems 766A3.4 An Example: One-factor Black-Scholes PDE 768Contents xviiA3.5 Boundary Conditions 769A3.6 Example: Boundary Conditions for the One-factor Black-Scholes PDE 772A3.7 Motivating the ADE Method 772A3.8 The ADE Method Exposed 773A3.9 The Convection Term 773A3.10 Other Kinds of Boundary Conditions 774A3.11 Nonlinear Problems 775A3.12 ADE for PDEs in Conservative Form 775A3.13 Numerical Results and Guidelines 776A3.13.1 The Consequences of Conditional Consistency 776A3.13.2 Call Payoff Behaviour at the Far Field 777A3.13.3 General Formulation of the ADE Method 777A3.14 The Steps to Use when Implementing ADE 778A3.15 Summary and Conclusions 778A3.16 Exercises and Projects 779A4 Cap, Floor and Swaption Using Excel-DNA 789A4.1 Introduction 789A4.2 Different Ways of Stripping Cap Volatility 789A4.3 Comparing Caplet Volatility Surface 792A4.4 Call Put Parity 794A4.5 Cap Price Matrix 795A4.6 Multi-strike and Amortising 797A4.7 Simple Swaption Formula 798A4.8 Swaption Straddle 800A4.9 Exercises 804Bibliography 805Web References 812Index 815

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复